export function useShow(_show = false) {
  const show = ref(_show);
  let timeOut: NodeJS.Timeout | null;
  function switchShow(autoClose = true) {
    if (timeOut) {
      clearTimeout(timeOut);
      timeOut = null;
    }
    show.value = !show.value;
    if (!autoClose) return;
    if (show.value && !timeOut)
      timeOut = setTimeout(() => {
        show.value = false;
        timeOut = null;
      }, 3000);
  }
  return {
    show,
    switchShow,
  };
}
